home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / gutenprintui2 / curve.h next >
Encoding:
C/C++ Source or Header  |  2008-03-15  |  4.0 KB  |  128 lines

  1. /* GTK - The GIMP Toolkit
  2.  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3.  *
  4.  * This library is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU Lesser General Public
  6.  * License as published by the Free Software Foundation; either
  7.  * version 2 of the License, or (at your option) any later version.
  8.  *
  9.  * This library is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.  * Lesser General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU Lesser General Public
  15.  * License along with this library; if not, write to the
  16.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.  * Boston, MA 02111-1307, USA.
  18.  */
  19.  
  20. /*
  21.  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
  22.  * file for a list of people on the GTK+ Team.  See the ChangeLog
  23.  * files for a list of changes.  These files are distributed with
  24.  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  25.  */
  26.  
  27. /*
  28.  * NOTE this widget is considered too specialized/little-used for
  29.  * GTK+, and will in the future be moved to some other package.  If
  30.  * your application needs this widget, feel free to use it, as the
  31.  * widget does work and is useful in some applications; it's just not
  32.  * of general interest. However, we are not accepting new features for
  33.  * the widget, and it will eventually move out of the GTK+
  34.  * distribution.
  35.  */
  36.  
  37. #ifndef GUTENPRINTUI_CURVE_H
  38. #define GUTENPRINTUI_CURVE_H
  39.  
  40.  
  41. #include <gdk/gdk.h>
  42. #include <gtk/gtkdrawingarea.h>
  43.  
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif /* __cplusplus */
  47.  
  48.  
  49. #define STPUI_TYPE_CURVE                  (stpui_curve_get_type ())
  50. #define STPUI_CURVE(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), STPUI_TYPE_CURVE, StpuiCurve))
  51. #define STPUI_CURVE_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), STPUI_TYPE_CURVE, StpuiCurveClass))
  52. #define STPUI_IS_CURVE(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STPUI_TYPE_CURVE))
  53. #define STPUI_IS_CURVE_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), STPUI_TYPE_CURVE))
  54. #define STPUI_CURVE_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), STPUI_TYPE_CURVE, StpuiCurveClass))
  55.  
  56.  
  57. /* Curve types */
  58. typedef enum
  59. {
  60.   STPUI_CURVE_TYPE_LINEAR,       /* linear interpolation */
  61.   STPUI_CURVE_TYPE_SPLINE,       /* spline interpolation */
  62.   STPUI_CURVE_TYPE_FREE          /* free form curve */
  63. } StpuiCurveType;
  64.  
  65.  
  66. typedef struct _StpuiCurve    StpuiCurve;
  67. typedef struct _StpuiCurveClass    StpuiCurveClass;
  68.  
  69.  
  70. struct _StpuiCurve
  71. {
  72.   GtkDrawingArea graph;
  73.  
  74.   gint cursor_type;
  75.   gfloat min_x;
  76.   gfloat max_x;
  77.   gfloat min_y;
  78.   gfloat max_y;
  79.   GdkPixmap *pixmap;
  80.   StpuiCurveType curve_type;
  81.   gint height;                  /* (cached) graph height in pixels */
  82.   gint grab_point;              /* point currently grabbed */
  83.   gint last;
  84.  
  85.   /* (cached) curve points: */
  86.   gint num_points;
  87.   GdkPoint *point;
  88.  
  89.   /* control points: */
  90.   gint num_ctlpoints;           /* number of control points */
  91.   gfloat (*ctlpoint)[2];        /* array of control points */
  92. };
  93.  
  94. struct _StpuiCurveClass
  95. {
  96.   GtkDrawingAreaClass parent_class;
  97.  
  98.   void (* curve_type_changed) (StpuiCurve *curve);
  99.  
  100.   /* Padding for future expansion */
  101.   void (*_gtk_reserved1) (void);
  102.   void (*_gtk_reserved2) (void);
  103.   void (*_gtk_reserved3) (void);
  104.   void (*_gtk_reserved4) (void);
  105. };
  106.  
  107.  
  108. GType        stpui_curve_get_type    (void) G_GNUC_CONST;
  109. GtkWidget*    stpui_curve_new        (void);
  110. void        stpui_curve_reset    (StpuiCurve *curve);
  111. void        stpui_curve_set_gamma    (StpuiCurve *curve, gfloat gamma_);
  112. void        stpui_curve_set_range    (StpuiCurve *curve,
  113.                      gfloat min_x, gfloat max_x,
  114.                      gfloat min_y, gfloat max_y);
  115. void        stpui_curve_get_vector    (StpuiCurve *curve,
  116.                      int veclen, gfloat vector[]);
  117. void        stpui_curve_set_vector    (StpuiCurve *curve,
  118.                      int veclen, const gfloat vector[]);
  119. void        stpui_curve_set_curve_type (StpuiCurve *curve, StpuiCurveType type);
  120.  
  121.  
  122. #ifdef __cplusplus
  123. }
  124. #endif /* __cplusplus */
  125.  
  126.  
  127. #endif /* GUTENPRINTUI_CURVE_H */
  128.